<template>
  <el-dialog
      :title="title"
      :visible.sync="visible"
      width="600px"
      :close-on-click-modal="false"
      @closed="resetForm"
  >
    <!--表单-->
    <el-form
        ref="companyForm"
        :model="formModel"
        :rules="formRules"
        label-width="120px"
        label-position="right"
    >

      <el-form-item label="公司名称" prop="name">
        <el-input
            v-model="formModel.name"
            placeholder="请输入公司名称"
            clearable
        ></el-input>
      </el-form-item>

      <el-form-item label="成立日期" prop="establishmentDate">
        <el-date-picker
            v-model="formModel.establishmentDate"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
            style="width: 100%"
        ></el-date-picker>
      </el-form-item>

      <el-form-item label="注册资本(万元)" prop="registeredCapital">
        <el-input
            v-model.number="formModel.registeredCapital"
            placeholder="请输入注册资本"
            type="number"
            min="0"
            step="0.01"
            append="万元"
        >
        </el-input>
      </el-form-item>

      <el-form-item label="运营状态" prop="operating">
        <el-switch
            v-model="formModel.operating"
            active-text="运营中"
            inactive-text="已停业"
        ></el-switch>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="visible = false;">取 消</el-button>
      <el-button type="primary" @click="submitForm" :loading="submitting">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import Handler from './CompanyForm.js'

export default Handler
</script>

<style scoped lang="scss">
@import './CompanyForm.scss';
</style>
